package org.yi.fc.validator.admin;

import org.yi.fc.entity.FUser;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

public class ContentValidator extends Validator {

	@Override
	protected void handleError(Controller controller) {
		controller.keepModel(FUser.class);
		
		String actionKey = getActionKey();
		if (actionKey.equals("/admin/login"))
			controller.render("login.html");
	}

	@Override
	protected void validate(Controller controller) {
		validateRequiredString("email", "email", "请输入账号");
		validateRequiredString("password", "password", "请输入密码");
	}

}
